<link type="text/css" href="/admins/js/pagerView/pager-view.css" rel="stylesheet" />
<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/admins/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="/admins/js/jquery/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="/admins/js/pagerView/pager-view.js"></script>
<script type="text/javascript">
    $(function(){
    
        $.datepicker.setDefaults( $.datepicker.regional[ "zh-CN" ] );
        $( "#form1 #startTime" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
        $( "#form1 #dateExpired" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
    });
</script>
<form action="/admini/manageuser/couponbatch/" method="get" style="margin:0px" id="form1">
    <div style=" border:1px solid #DDDDDD; padding:2px; margin:2px;" id='sel'>
        <label for="no">批次序号：</label><input type="text" id="no" name="no" value="<?php echo $this->no; ?>" />
        <label for="time">开始时间：</label><input type="text" id="startTime" name="startTime" value="<?php echo $this->startTime; ?>" />
        <label for="time">- 结束时间：<input type="text" id="dateExpired" name="dateExpired" value="<?php echo $this->dateExpired; ?>" />
        <label for="status">状态：<select id="status" name="status" >
                <option value="">所有</option>
                <option value="1" <?php echo $this->status == 1?"selected":"";?> >正常</option>
                <option value="2" <?php echo $this->status == 2?"selected":"";?> >已过期</option>
            </select>
        <input type="submit" id="queryButton" value="查询"/>
    </div>
</form>
    <div class="dataTable">
        <table>  
            <tfoot>
             <tr><td colspan="14">
                     <button class="button" id="add-button" style="background-color: #FF8312;width: 100px;height: 30px;color: white;font-size: 14px;border-radius:8px;">添加批次</button>
                     <button class="button" id="coupon-button" style="background-color: #1668A4;width: 100px;height: 30px;color: white;font-size: 14px;border-radius:8px;">优惠券类别</button>                     
                 </td></tr>
            </tfoot>
           <tr>
                <th class="w1" width="8%">批次序号</th>
                <th class="w2" width="8%">名称</th>
                <th class="w3" width="8%">创建时间</th>
                <th class="w4" width="8%">开始时间</th>
                <th class="w5" width="8%">类型</th>
                <th class="w6" width="8%">底线金额</th>
                <th class="w7" width="8%">折扣</th>
                <th class="w8" width="8%">用户类型</th>
                <th class="w9" width="8%">优惠券数量</th>
                <th class="w10" width="8%">已发数量</th>
                <th class="w11" width="8%">状态</th>
            </tr>  
        
            <?php if($this->batchlist != ''){
                foreach ($this->batchlist as $Item) { ?> 
                <tr align="center">
                    <td class="w1" nowrap align="center"><?php echo $Item->no; ?></td>
                    <td class="w2" nowrap align="center"><?php echo $Item->name; ?></td>
                    <td class="w3" nowrap><?php echo $Item->dateStart;?></td>
                    <td class="w4" nowrap><?php echo $Item->dateEnd; ?></td>
                    <td class="w5" nowrap align="center"><?php echo $Item->type; ?></td>
                    <td class="w6" nowrap align="center"><?php echo $Item->money; ?></td>
                    <td class="w6" nowrap align="center"><?php echo $Item->discount; ?></td>
                    <td class="w7" nowrap align="center"><?php echo $Item->userType; ?></td>
                    <td class="w8" nowrap align="center"><?php echo $Item->maxCount; ?></td>
                    <td class="w8" nowrap align="center"><a href="/admini/manageuser/coupon/batchNo/<?php echo $Item->no;?>" class="indexa"><?php echo $Item->giveCount; ?></a></td>
                    <td class="w9" nowrap align="center"><?php echo $Item->status; ?></td>
                 </tr>         
            <?php } }?>
        </table>
    </div>                
    <div class="toolbar">
        <?php echo $this->partial('paging.phtml', array("pages" => $this->batchall,"pamas"=>"no=".$this->no."&startTime=$this->startTime&dateExpired=$this->dateExpired&status=$this->status")); ?>
    </div>   
<script type="text/javascript">
   $("#add-button").click(function(){
       location.href = "/admini/manageuser/addbatch";
   });
   $("#coupon-button").click(function(){
       location.href = "/admini/manageuser/coupon";
   });
</script>